#pragma once

#include "pc/video_track_source.h"
#include "video_capturer.hpp"

namespace p2pms 
{

class CapturerTrackSource : public webrtc::VideoTrackSource 
{
public:
	static rtc::scoped_refptr<CapturerTrackSource> Create(
		size_t width, 
		size_t height,
		size_t fps,
		const std::string& device_id);

protected:
	explicit CapturerTrackSource(std::unique_ptr<VideoCapturer> capturer);

private:
	rtc::VideoSourceInterface<webrtc::VideoFrame>* source();
  
	std::unique_ptr<VideoCapturer> m_capturer;
};

}